import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/views/index/IndexView";
import HomeView from "@/views/home/HomeView";
import Seller from "@/views/seller/IndexView"
import UpdateSellerView from "@/views/seller/UpdateSellerView";
import SellerPasswordView from "@/views/seller/SellerPasswordView";
import AddGoodsView from "@/views/seller/AddGoodsView";
import GoodsView from "@/views/seller/GoodsView";
import ExtendedPropsView from "@/views/seller/goods/ExtendedPropsView";
import GoodsBasicInfoView from "@/views/seller/goods/GoodsBasicInfoView";
import SpecView from "@/views/seller/goods/SpecView";
import LoginView from "@/views/seller/goods/LoginView";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: IndexView,
    children:[
      {
        path: '/',
        name: 'home',
        component: HomeView
      },
      {
        path: '/seller',
        name: 'seller',
        component: Seller,
        children: [
          {
            path: "update",
            name: "update",
            component: UpdateSellerView
          },
          {
            path: "password",
            name: "password",
            component: SellerPasswordView
          },
          {
            path: "add",
            name: "add",
            component: AddGoodsView
          },
          {
            path: "goods",
            name: "goods",
            component: GoodsView
          },
        ]
      }
    ]
  },
  {
    path: "/extended",
    component: ExtendedPropsView
  },
  {
    path: "/goodBasic",
    component: GoodsBasicInfoView
  },
  {
    path: "/spec",
    component: SpecView
  },
  {
    path: "/login",
    component: LoginView
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
